# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time

  # See ActionController::RequestForgeryProtection for details
  # Uncomment the :secret if you're not using the cookie session store
  protect_from_forgery # :secret => 'c1469215a76201bcea9e82bae193e0fa'
  
  # See ActionController::Base for details 
  # Uncomment this to filter the contents of submitted sensitive data parameters
  # from your application log (in this case, all fields with names like "password"). 
  # filter_parameter_logging :password
  
  session :session_key => "e77732914f52aa1e6cf1a496a50271b35cb82f0fa55acc497878c9f61bbf7d9b97b94511a83da1128d8d77d54dab4c3b80db4f994fadf7d47c2f03066f55eb1b"
  before_filter :authorize
  protected
  def secure?
    false
  end
  private
  def authorize
    if secure? && session[:user_id].nil?
      session[:return_to] = request.request_uri
      redirect_to :controller => "login", :action => "login"
      return false
    end
  end
end
